/*
 * Copyright (c) 2011 Nokia Corporation.
 */

#ifndef MESSAGE_H
#define MESSAGE_H

#include <QObject>
#include <QPixmap>

// QtMobility API headers
// Messaging
#include <QMessage>
#include <QMessageManager>
#include <QMessageService>

// QtMobility namespace
QTM_USE_NAMESPACE

class Message: public QObject
{
Q_OBJECT

public:
    Message(QObject *parent = 0);
    ~Message();

    void checkMessages();
    bool sendMMS(QString picturePath, QString phoneNumber);

private:
    void processIncomingMMS(const QMessageId& id);

public slots:
    // QMessageService
    void stateChanged(QMessageService::State s);
    void messagesFound(const QMessageIdList &ids);

    // QMessageManager
    void messageAdded(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);

signals:
    void messageStateChanged(int);
    void messageReceived(QString from, QString filename, QPixmap pixmap);

private:
    QMessageService* m_service;
    QMessageManager* m_manager;
    QMessageManager::NotificationFilterIdSet m_notifFilterSet;
    QMessageId m_messageId;
};

#endif // MESSAGE_H
